<!DOCTYPE html>
<title>Tests that a media file specified with a query url is opened successfully.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../../media-resources/media-file.js"></script>
<body>
<video></video>
<script>
async_test(function(t) {
    var iframe = document.createElement('iframe');

    iframe.onload = t.step_func(function() {
        var movie = 'test.ogv';
        var type = mimeTypeForExtension(movie.split('.').pop());
        var video = document.querySelector('video');
        video.onerror = t.unreached_func();
        video.oncanplay = t.step_func_done();
        video.src = 'http://127.0.0.1:8000/media/resources/load-video.php?name=' + movie + '&type=' + type;
    });

    iframe.src = 'data:text/html,<b>test</b>';
    document.body.appendChild(iframe);
});
</script>